<div class="row">
    <div class="col-lg-8 col-lg-offset-2 text-center m-t-lg m-b-lg">
        <p id="jalpc_site_pv"><strong>&copy; {{ 'now' | date: "%Y" }} {{ site.title }}</strong></p>
    </div>
</div>

{% include analytics.html %}

{% if site.disqus %}
  <script id="dsq-count-scr" src="//jalpc.disqus.com/count.js" async></script>
  <script type="text/javascript">
    var disqusShortName = "{{ site.disqus.name }}";

    var disqusPublicKey = "{{ site.disqus.public_key }}";

    var urlArray = [];
    $('.disqus-comment-count').each(function () {
      var url = $(this).attr('data-disqus-url');
      urlArray.push('link:' + url);
    });
    $.ajax({
      type: 'GET',
      url: "https://disqus.com/api/3.0/threads/set.jsonp",
      data: { api_key: disqusPublicKey, forum : disqusShortName, thread : urlArray },
      cache: false,
      dataType: "jsonp",
      success: function (result) {
        for (var i in result.response) {
          var count = result.response[i].posts;
          if ( count ) {
            $('.disqus-comment-count[data-disqus-url="' + result.response[i].link + '"]').html(count);
          }
        }
      }
    });
</script>
{% endif %}
